package 二叉树题目.二叉树的镜像;

public class Solution {
    public TreeNode Mirror (TreeNode pRoot) {
        TreeNode cur = pRoot;
        TreeNode tmp = null;
        // write code here
        if (cur == null){
            return null;
        }
        if (cur.left == null && cur.right == null ){
            return cur;
        }
        tmp = cur.left;
        cur.left = cur.right;
        cur.right = tmp;
        Mirror(cur.left);
        Mirror(cur.right);
        return pRoot;
    }
}
